Imports System.Data.OleDb

Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TBName.TextChanged

    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub Submit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Submit.Click
        Dim cty As String = TBName.Text
        Dim ccy As String = TbName1.Text


        If FileUpload1.HasFile Then
            Dim Fname = FileUpload1.FileName
            Dim webfolder = Request.MapPath(".")
            Dim ImageFolder = webfolder & "/Images/"
            FileUpload1.SaveAs(ImageFolder & Fname)
            Dim oleDBConn As New OleDbConnection(ConfigurationManager.ConnectionStrings("AllAboutForexDBConnectionString").ConnectionString)
            Dim sqlstmt As String = "INSERT INTO Country_CURRENCY([Country] , [Currency] , [Symbol]) VALUES (@Country,@Currency, @symbol)"
            Dim cmd As New OleDbCommand(sqlstmt, oleDBConn)
            cmd.Parameters.AddWithValue("@Country", cty)
            cmd.Parameters.AddWithValue("@Currency", ccy)
            cmd.Parameters.AddWithValue("@Symbol", "Images/" & Fname)
            oleDBConn.Open()
            cmd.ExecuteNonQuery()
            oleDBConn.Close()



        End If

    End Sub
End Class
